package com.androidx.p013lv.mine.adapter;

import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.androidx.p013lv.base.bean.VideoBean;
import com.androidx.p013lv.base.glide.GlideUtils;
import com.androidx.p013lv.base.listener.ItemClickListener;
import com.androidx.p013lv.base.p015ui.BaseActivity;
import com.androidx.p013lv.base.recycler.BaseRecyclerAdapter;
import com.androidx.p013lv.base.recycler.BaseRecyclerHolder;
import com.androidx.p013lv.base.view.CircleImageView;
import com.androidx.p013lv.mine.C1207R;
import com.androidx.p013lv.mine.bean.AttentionBean;

/* renamed from: com.androidx.lv.mine.adapter.MineAttentionAdapter */
public class MineAttentionAdapter extends BaseRecyclerAdapter<AttentionBean.DataBean, Holder> {
    private Context context;
    private String domain;

    public MineAttentionAdapter(Context context2) {
        this.context = context2;
    }

    public void setDomain(String str) {
        this.domain = str;
    }

    public void MyHolder(Holder holder, int i) {
        holder.setData((AttentionBean.DataBean) getDataInPosition(i));
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public Holder onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new Holder(LayoutInflater.from(viewGroup.getContext()).inflate(C1207R.C1212layout.item_mine_attention, viewGroup, false));
    }

    /* access modifiers changed from: package-private */
    /* renamed from: com.androidx.lv.mine.adapter.MineAttentionAdapter$Holder */
    public class Holder extends BaseRecyclerHolder {
        private ItemAttentionAdapter itemAdapter;
        CircleImageView iv_cover;
        RecyclerView recycler;
        TextView tv_name;

        Holder(View view) {
            super(view);
            this.iv_cover = (CircleImageView) view.findViewById(C1207R.C1210id.iv_cover);
            this.tv_name = (TextView) view.findViewById(C1207R.C1210id.tv_name);
            this.recycler = (RecyclerView) view.findViewById(C1207R.C1210id.recycler);
            ItemAttentionAdapter itemAttentionAdapter = new ItemAttentionAdapter();
            this.itemAdapter = itemAttentionAdapter;
            itemAttentionAdapter.setDomain(MineAttentionAdapter.this.domain);
            this.recycler.setLayoutManager(new LinearLayoutManager(MineAttentionAdapter.this.context, 0, false));
            this.recycler.setAdapter(this.itemAdapter);
            view.findViewById(C1207R.C1210id.btn_more).setOnClickListener(this);
        }

        /* access modifiers changed from: package-private */
        public void setData(AttentionBean.DataBean dataBean) {
            if (TextUtils.isEmpty(dataBean.getHeadImg())) {
                GlideUtils.loadPicHeadDefault(this.iv_cover);
            } else {
                GlideUtils.loadPicHead(MineAttentionAdapter.this.domain + dataBean.getHeadImg(), this.iv_cover);
            }
            this.tv_name.setText(dataBean.getContentName());
            this.itemAdapter.setData(dataBean.getVideoList());
            this.itemAdapter.setItemListener(new ItemClickListener() {
                /* class com.androidx.p013lv.mine.adapter.MineAttentionAdapter.Holder.C12861 */

                @Override // com.androidx.p013lv.base.listener.ItemClickListener
                public void onItemClick(View view, int i) {
                    ((BaseActivity) MineAttentionAdapter.this.context).startVideoPlay(((VideoBean) Holder.this.itemAdapter.getDataInPosition(i)).getVideoId());
                }
            });
        }
    }
}
